﻿@{
    Layout = "";
}

<div class="box">
	<div class="box-header with-border">
		<h3 id="box-title" class="box-title"></h3>
	</div>
	<div class="box-body">
		<div class="table-responsive">
			<form id="form_list" action="./del" method="post">
				<input type="hidden" name="__callback" value="del_callback"/>
				<table id="GridView1" cellspacing="0" rules="all" border="1" style="border-collapse:collapse;" class="table table-bordered table-hover text-nowrap">
					<tr>
						<th scope="col">任务编号</th>
						<th scope="col" class="text-right">第几轮</th>
						<th scope="col" class="text-right">耗时</th>
						<th scope="col" class="text-center">是否成功</th>
						<th scope="col">异常信息</th>
						<th scope="col">备注</th>
						<th scope="col">创建时间</th>
					</tr>
					<tbody>
						@foreach(TaskLog item in ViewBag.items) {
							<tr>
								<td>@item.TaskId</td>
								<td class="text-right">@item.Round</td>
								<td class="text-right">@(item.ElapsedMilliseconds)ms</td>
								<td class="text-center">@Html.Raw(item.Success ? "<font color=green>是</font>" : "<font color=red>否</font>")</td>
								<td>@item.Exception</td>
								<td>@item.Remark</td>
								<td>@item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
                            </tr>
						}
					</tbody>
				</table>
			</form>
			<div id="kkpager"></div>
		</div>
	</div>
</div>

@{
}
<script type="text/javascript">
	(function () {
		top.del_callback = function(rt) {
			if (rt.code == 0) return top.mainViewNav.goto('./?' + new Date().getTime());
			alert(rt.message);
		};

		var qs = _clone(top.mainViewNav.query);
		var page = cint(qs.page, 1);
		delete qs.page;
		$('#kkpager').html(cms2Pager(@ViewBag.count, page, 20, qs, 'page'));
		var fqs = _clone(top.mainViewNav.query);
		delete fqs.page;
		var fsc = [
			null
		];
		fsc.pop();
		cms2Filter(fsc, fqs);
		top.mainViewInit();
	})();
</script>